package ldg.mybatis.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import ldg.mybatis.model.Comment;
import ldg.mybatis.service.CommentResultMapService;

@SuppressWarnings("serial")
public class CommentResultMapOneServlet extends HttpServlet {
	@Override
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {

		Long commentNo = Long.parseLong(req.getParameter("commentNo"));

		CommentResultMapService commentService = new CommentResultMapService();
		Comment comment = commentService.selectByPrimaryKey(commentNo);

		PrintWriter out = resp.getWriter();

		if (null != comment) {
			out.println("<BR>");
			out.println(comment.getUserId());
			out.println("<BR>");
			out.println(comment.getCommentNo());
			out.println("<BR>");
			out.println(comment.getRegDate());
			out.println("<BR>");
		} else {
			out.println("<BR>");
			out.println("Results Not Found");
		}
		out.close();

	}
}
